<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <button @click="fun(-1)">上一页</button>
        <img :src="imgs[index]">
        <button @click="fun(1)">下一页</button>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>

    <script>
        const app = new Vue({
            el: '#app',
            data: {
                imgs: [
                    "./案例图片/波仔1.png",
                    "./案例图片/波仔2.png",
                    "./案例图片/波仔3.png",
                    "./案例图片/波仔4.png",
                    "./案例图片/波仔5.png",
                    "./案例图片/波仔6.png"
                ],
                index: 0
            },
            methods: {
                fun(a) {
                    if (this.index === 5 && a === 1) this.index = 0
                    if (this.index === 0 && a === -1) this.index = 6
                    this.index = this.index + a
                }
            }

        })
    </script>
</body>

</html>